.class final Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;
.super Ljava/lang/Object;
.source "UiExceptionHandlerManager.java"

# interfaces
.implements Ljava/lang/Thread$UncaughtExceptionHandler;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/burstly/lib/exception/UiExceptionHandlerManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1a
    name = "UnhandledExceptionWrapper"
.end annotation


# static fields
.field private static final HANDLERS:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/Thread$UncaughtExceptionHandler;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field private final mDefaultHandler:Ljava/lang/Thread$UncaughtExceptionHandler;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 83
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    sput-object v0, Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;->HANDLERS:Ljava/util/Set;

    return-void
.end method

.method private constructor <init>(Ljava/lang/Thread$UncaughtExceptionHandler;)V
    .locals 0
    .parameter "defaultHandler"

    .prologue
    .line 95
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 96
    iput-object p1, p0, Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;->mDefaultHandler:Ljava/lang/Thread$UncaughtExceptionHandler;

    .line 97
    return-void
.end method

.method synthetic constructor <init>(Ljava/lang/Thread$UncaughtExceptionHandler;Lcom/burstly/lib/exception/UiExceptionHandlerManager$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 78
    invoke-direct {p0, p1}, Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;-><init>(Ljava/lang/Thread$UncaughtExceptionHandler;)V

    return-void
.end method

.method static synthetic access$200()Ljava/util/Set;
    .locals 1

    .prologue
    .line 78
    sget-object v0, Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;->HANDLERS:Ljava/util/Set;

    return-object v0
.end method


# virtual methods
.method public uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V
    .locals 4
    .parameter "t"
    .parameter "e"

    .prologue
    .line 101
    invoke-static {}, Lcom/burstly/lib/exception/UiExceptionHandlerManager;->access$000()Lcom/burstly/lib/util/Utils$DebugWrapper;

    move-result-object v2

    invoke-virtual {v2}, Lcom/burstly/lib/util/Utils$DebugWrapper;->logAll()V

    .line 102
    instance-of v2, p2, Ljava/lang/OutOfMemoryError;

    if-nez v2, :cond_0

    invoke-virtual {p2}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;

    move-result-object v2

    instance-of v2, v2, Ljava/lang/OutOfMemoryError;

    if-nez v2, :cond_0

    .line 103
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "BurstlySDK="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {}, Lcom/burstly/lib/BurstlySdk;->getSdkVersion()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "-"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    sget-object v3, Lcom/burstly/lib/constants/Constants;->BUILD_ID:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {p2, v2}, Lcom/burstly/lib/util/Utils;->addInStackTrace(Ljava/lang/Throwable;Ljava/lang/String;)V

    .line 105
    :cond_0
    sget-object v2, Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;->HANDLERS:Ljava/util/Set;

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Thread$UncaughtExceptionHandler;

    .line 106
    .local v0, handler:Ljava/lang/Thread$UncaughtExceptionHandler;
    invoke-interface {v0, p1, p2}, Ljava/lang/Thread$UncaughtExceptionHandler;->uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V

    goto :goto_0

    .line 108
    .end local v0           #handler:Ljava/lang/Thread$UncaughtExceptionHandler;
    :cond_1
    iget-object v2, p0, Lcom/burstly/lib/exception/UiExceptionHandlerManager$UnhandledExceptionWrapper;->mDefaultHandler:Ljava/lang/Thread$UncaughtExceptionHandler;

    invoke-interface {v2, p1, p2}, Ljava/lang/Thread$UncaughtExceptionHandler;->uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V

    .line 109
    return-void
.end method
